<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AddressRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'full_name' => 'required',
            'phone' => 'required',
            'province' => 'required',
            'city' => 'required',
            'district' => 'required',
            'street' => 'required',
        ];
    }

    public function messages() {
        return [
            'full_name.required' => '收件人姓名不能为空',
            'phone.required' => '联系电话不能为空',
            'province.required' => '省份不能为空',
            'city.required' => '城市不能为空',
            'district.required' => '区不能为空',
            'street.required' => '街道门牌号不能为空',
        ];
    }
}
